﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class DiagnoseDetailsForm : Form
    {
        private Diagnose diagnose;

        public DiagnoseDetailsForm(Diagnose diagnos2)
        {
            InitializeComponent();
            diagnose = diagnos2;
            if (diagnose.ID.HasValue)
            {
                IDTextBox.Text =  "" + diagnose.ID.Value;
            }  
            else
            {
                IDTextBox.Text = "";
            }
            NameTextBox.Text = diagnose.name;
            DescrTextBox.Text = diagnose.description;
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void OKBtn_Click(object sender, EventArgs e)
        {
            diagnose.name = NameTextBox.Text;
            diagnose.description = DescrTextBox.Text;
            DialogResult = DialogResult.OK;
            Close();
        }

        private void CancelBtn_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure you want to cancel new diagnose addition?", "Diagnose details", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                DialogResult = DialogResult.Cancel;
                Close();
            }
           

        }

        private void DescrTextBox_TextChanged(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void DiagnoseDetailsForm_Load(object sender, EventArgs e)
        {

        }


    }
}
